import { createRouter, createWebHashHistory } from "vue-router";

import Analyse from "../views/Home/Analyse/index.vue";
import fenxiyewu from "../views/Home/Analyse/fenxiyewu/index.vue";
import yaopin from "../views/Home/Analyse/yaopin/index.vue"
import jibing from '../views/Home/Analyse/jibing/index.vue'
import huanze from "../views/Home/Analyse/huanze/index.vue"
import yisheng from "../views/Home/Analyse/yisheng/index.vue"
import Control from "../views/Home/Control/index.vue";
import jcrw from "../views/Home/Control/jicai/jcrw.vue";
import rwzx from "../views/Home/Control/jicai/rwzx.vue";
import yplr from "../views/Home/Control/yaopingguankong/yplr.vue";
import ypml from "../views/Home/Control/yaopingguankong/ypml.vue";
import MedicineHopper from "../views/Home/MedicineHopper/index.vue";
import peizhi from "../views/Home/MedicineHopper/peizhi/index.vue"
import buhuo from "../views/Home/MedicineHopper/buhuo/index.vue"
import Prescription from "../views/Home/Prescription/index.vue";
import Found from "../views/Home/Prescription/Found/index.vue";
import Patient from "../views/Home/Prescription/Patient/index.vue";
import Scheduling from "../views/Home/Scheduling/index.vue";
import gzbg from "../views/Home/Scheduling/gzbg.vue";
import rypb from "../views/Home/Scheduling/rypb.vue";
import sdpz from "../views/Home/Scheduling/sdpz.vue";
import Storeroom from "../views/Home/Storeroom/index.vue";
import Kufang from "../views/Home/Storeroom/kufang/index.vue";
import Kuchun from "../views/Home/Storeroom/kuchun/index.vue";
import Liushui from "../views/Home/Storeroom/liushui/index.vue";
import Pandian from "../views/Home/Storeroom/pandian/index.vue";
import Home from "../views/Home/index.vue";
import Config from "../views/Home/Config/index.vue";
import jicheng from "../views/Home/Config/jicheng/index.vue";
import rizhi from "../views/Home/Config/rizhi/index.vue";
import xiaoxi from "../views/Home/Config/xiaoxi/index.vue";
import xitong from "../views/Home/Config/xitong/index.vue";
import yewu from "../views/Home/Config/yewu/index.vue";
import yonghu from "../views/Home/Config/yonghu/index.vue";
import Admin from "../views/Home/Admin/index.vue";
import Login from "../views/Login/index.vue";

const routes = [
  {
    path: "/",
    component: Home,
    redirect: "Prescription",
    children: [
      {
        path: "Prescription",
        component: Prescription,
        redirect: "/Found",
        children: [
          {
            path: "/Found",
            component: Found,
          },
          {
            path: "/Patient",
            component: Patient,
          },
        ],
      },
      {
        path: "/Analyse",
        redirect:"/fenxiyewu",
        component: Analyse,
        children: [
          {
            path: "/fenxiyewu",
            component:fenxiyewu
          },
          {
            path: "/yaopin",
            component:yaopin
          },
          {
            path: "/jibing",
            component:jibing
          },
          {
            path: "/huanze",
            component:huanze
          },
          {
            path: "/yisheng",
            component:yisheng
          }
        ]
      },
      {
        path: "/Control",
        component: Control,
        redirect: "/jcrw",
        children: [
          {
            path: "/jcrw",
            component:jcrw,
          },
          {
            path: "/rwzx",
            component:rwzx,
          },
          {
            path: "/yplr",
            component:yplr,
          },
          {
            path: "/ypml",
            component:ypml,
          }
        ]
      },
      {
        path: "/MedicineHopper",
        component: MedicineHopper,
        redirect: "/peizhi",
        children: [
          {
            path: "/peizhi",
            component:peizhi
          },
          {
            path: "/buhuo",
            component:buhuo
          }
        ]
      },
      {
        path: "/Scheduling",
        component: Scheduling,
        redirect:'/rypb',
        children: [
          {
            path: "/gzbg",
            component:gzbg
          },
          {
            path: "/rypb",
            component:rypb
          },
          {
            path: "/sdpz",
            component:sdpz
          }
        ]
      },
      {
        path: "/Storeroom",
        redirect: "/Kufang",
        component: Storeroom,

        children: [
          {
            path: "/Kufang",
            component: Kufang,
          },
          {
            path: "/Kuchun",
            component: Kuchun,
          },
          {
            path: "/Liushui",
            component: Liushui,
            
          },
          {
            path: "/Pandian",
            component: Pandian,
          },
        ],
      },
      {
        path: "/Config",
        component: Config,
        redirect:'/yonghu',
        children: [
          {
            path: "/yonghu",
            component:yonghu,
          },
          {
            path: '/xiaoxi',
            component:xiaoxi,
          },
          {
            path: '/xitong',
            component:xitong,
          },
          {
            path: '/yewu',
            component:yewu,
          },
          {
            path: '/jicheng',
            component:jicheng,
          },
          {
            path: '/rizhi',
            component:rizhi,
          }
        ]
      },
      {
        path: "/Admin",
        component: Admin,
      },
    ],
  },
  {
    path: "/Login",
    component: Login,
  },
];

const router = createRouter({
  routes,
  history: createWebHashHistory(),
  scrollBehavior() {
    return { top: 0 };
  },
});

export default router;
